package com.cloud.screen.api.controller;

import com.cloud.screen.api.service.LawCaseService;
import com.cloud.screen.common.result.Quokka;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by csc on 2019/7/22.
 */

@RestController
@RequestMapping("screen/api/lawcase")
public class LawCaseController {

    @Autowired
    private LawCaseService lawCaseService;

    /**
     * 法律概况
     *
     * @return
     */
    @GetMapping("infogeneral")
    public Quokka getInfoGeneral() {
        return new Quokka(true, lawCaseService.getInfoGeneral());
    }

    /**
     * 法律概况
     *
     * @return
     */
    @GetMapping("statcauseexcutetype")
    public Quokka statCauseExcuteType() {
        return new Quokka(true, lawCaseService.statCauseExcuteType());
    }

    /**
     * 案卷分布
     *
     * @param start
     * @param end
     * @param regionid
     * @return
     */
    @GetMapping("getLegalCaseGroup")
    public Quokka getLegalCaseGroup(String start, String end, Long regionid) {
        return new Quokka(true, lawCaseService.getLegalCaseGroup(start, end, regionid));
    }

    /**
     * 执法领域
     *
     * @param start
     * @param end
     * @param regionid
     * @return
     */
    @GetMapping("getLegalCaseDomain")
    public Quokka getLegalCaseDomain(String start, String end, Long regionid) {
        return new Quokka(true, lawCaseService.getLegalCaseDomain(start, end, regionid));
    }

    /**
     * 区域分布
     *
     * @param start
     * @param end
     * @param regionid
     * @return
     */
    @GetMapping("getLegalCaseRegion")
    public Quokka getLegalCaseRegion(String start, String end, Long regionid) {
        return new Quokka(true, lawCaseService.getLegalCaseRegion(start, end, regionid));
    }

    /**
     * 案件指数
     *
     * @param start
     * @param end
     * @param regionid
     * @param type
     * @return
     */
    @GetMapping("getLegalCaseInfo")
    public Quokka getLegalCaseInfo(String start, String end, Long regionid, Integer type) {
        return new Quokka(true, lawCaseService.getLegalCaseInfo(start, end, regionid, type));
    }

    /**
     * Top10 法律法规
     *
     * @param start
     * @param end
     * @param regionid
     * @return
     */
    @GetMapping("getLawCaseTop")
    public Quokka getLawCaseTop(String start, String end, Long regionid) {
        return new Quokka(true, lawCaseService.getLawCaseTop(start, end, regionid));
    }


    /**
     * 法律法规使用
     *
     * @param start
     * @param end
     * @param regionid
     * @return
     */
    @GetMapping("getLawUseStat")
    public Quokka getLawUseStat(String start, String end, Long regionid) {
        return new Quokka(true, lawCaseService.getLawUseStat(start, end, regionid));
    }


    /**
     * 案由使用
     *
     * @param start
     * @param end
     * @param regionid
     * @return
     */
    @GetMapping("getCauseUseStat")
    public Quokka getCauseUseStat(String start, String end, Long regionid, String lawID) {
        return new Quokka(true, lawCaseService.getCauseUseStat(start, end, regionid, lawID));
    }
}
